Repository navigation
test: fix the atom mapping of XYZ frames in the stub interfaces - #985
Conversation
52cbae3 to
cbae5be
Compare
The CPU and GPU stub proxies copied the positions of each XYZ frame into the atom slots in file order, but the slots are numbered in the order in which atoms are requested: the atoms of the Colvars configuration first, then all others. Every test whose first atom group was not atoms 1..N in increasing order computed its variables on the wrong coordinates (e.g. angle_harmonic-fixed used atoms 1-4 instead of 1, 4, 10, 11). read_frame_xyz() now reads each frame in atom ID order and copies the positions into the slots through atoms_ids, and writes the force files in atom ID order. The buffers are kept as member variables. The reference outputs of the 99 affected functional tests are regenerated. New values were spot-checked against an independent numpy calculation (distance_harmonic-fixed, angle_harmonic-fixed). With the correct coordinates, frame 0 of trajectory.xyz coincides with rmsd_atoms_refpos.xyz and with a permutation of da_flipped.xyz, a point where rmsd and orientationAngle are not differentiable and tilt has a zero gradient, so the debugGradients checks of rmsd, rmsd_sym, orientationangle and tilt failed. Both reference files are perturbed by a uniform random displacement of up to 0.01 A per coordinate (all atoms of rmsd_atoms_refpos.xyz, atoms 6-9 of da_flipped.xyz; seed 20261022), and the references of the 21 tests using them are regenerated. These files are used only by the stub tests; engine tests have their own copies. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
debug_gradients() compared each finite-difference change with the analytic one relative to the size of that component alone. For components that are nearly zero this ratio is dominated by the rounding errors of the CVC values (a few ulp), and its value depends on how the compiler evaluates floating-point expressions. distancez-axis-fitgroup_harmonic-fixed has a fitting-group component of 1.4e-12 next to others of up to 2.9e-7; its error was 4.9e-4 with Clang on x86_64, but 1.1e-3 with GCC on ARM64 (FMA contraction) and with Intel oneAPI (-fp-model=fast), failing both CI jobs. No step size helps: a larger one makes the truncation error dominate. Errors are now measured against at least 1e-3 times the largest change predicted by any gradient component of the CVC, in both the CPU and GPU code paths. Components larger than that are checked exactly as before; for smaller ones, an error is flagged if it exceeds about 1e-6 of the largest component. The largest predicted change is logged once per CVC. The fitting-group comparisons also gain the denominator floor that only the main-group one had, so that 0/0 can no longer produce a NaN that record_gradient_error() silently ignores. Injecting wrong gradients into the 61 functional tests that use debugGradients (uniform 1% scaling, 1% error on the largest, median or smallest component, sign flips, swapped components, missing fit gradients) gives the same detections as before, with no false alarms. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
ab78cdd to
6bc7070
Compare
|
I see the issue in principle but I didn't expect it to matter in practice because in the caller code ( Looking into it further... |
Instead, adapt colvarproxy_stub::read_frame_xyz to read all coords from XYZ then extract relevant coords. Also write force output as XYZ trajectory file.
|
I see several issues: the test runners added all atoms as Colvars atoms, which is unnecessary and unrealistic. Instead I made the XYZ parser more flexible to allow for loading coordinates from a yet unknown system size. I made the force output an XYZ trajectory file for consistency, to be able to inspect in VMD, and to reduce the number of files. |
|
@jhenin The new changes break the GPU stub test. I got the following error: |
Since this is a fork of colvarproxy stubs, we need to keep them in sync, which is much easier if the file structure is similar
|
I have now adapted the GPU test as well. For that, I took out the colvarproxy_stubs_gpu class from the run_colvars_test_cuda sources to make it easier to compare the two implementations. The next step, ideally, would be merging the two codes altogether (the stubs classes, and the test runners) and conditionally including the GPU-related parts. That would remove a lot of duplicated code and help with future maintenance, but I'm not sure it is worth the effort. |
Thanks! However, after refactoring the code, the GPU stub interface fails to compile on HIP: The CUDA stub interface is good and the tests are all passed locally. I am looking into the changes to the CMakeLists.txt file to see if I can fix the HIP issue. |
Should be fixed in commit 0faff29. |
There was a problem hiding this comment.
🟡 Changes recommended
One or more issues must be addressed before approval.
2 open issues
What changed in this PR
This PR corrects XYZ atom mapping in the testing stub, updates GPU stub build integration, and refreshes regression references for the corrected coordinates.
Changes:
- Map XYZ coordinates and exported forces by atom ID rather than registration order.
- Adjust GPU stub compilation and error/debug logging.
- Perturb reference geometries to avoid zero-gradient cases and regenerate expected outputs.
| File | Description |
|---|---|
| tests/input_files/tilt_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/tilt_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/spinangle_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/spinangle_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/selfcoordnum-pairlist-large_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/selfcoordnum-pairlist_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/selfcoordnum-pairlist_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/selfcoordnum_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/selfcoordnum_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/rmsd-fitgroup_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/rmsd-fitgroup_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/rmsd_sym_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/rmsd_sym_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/rmsd_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/rmsd_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/rmsd_atoms_refpos.xyz | Updated as part of this pull request. |
| tests/input_files/protein_cvs/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/protein_cvs/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/polar_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/polar_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/orientationproj-fitgroup_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/orientationproj-fitgroup_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/orientationproj-fitgroup_harmonic-fixed-enableFitGradients/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/orientationproj-fitgroup_harmonic-fixed-enableFitGradients/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/orientationproj_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/orientationproj_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/orientationangle-fitgroup_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/orientationangle-fitgroup_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/orientationangle-fitgroup_harmonic-fixed-enableFitGradients/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/orientationangle-fitgroup_harmonic-fixed-enableFitGradients/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/orientationangle_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/orientationangle_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/orientation-fitgroup_harmonic-ori-moving/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/orientation-fitgroup_harmonic-ori-moving-enableFitGradients/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/orientation-fitgroup_harmonic-ori-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/orientation-fitgroup_harmonic-ori-fixed-enableFitGradients/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/orientation_harmonic-ori-moving/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/orientation_harmonic-ori-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/orientation_harmonic-ori-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/inertiaz_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/inertiaz_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/inertia_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/inertia_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/hbond_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/gyration_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/gyration_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/groupcoord-aniso_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/groupcoord-aniso_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/groupcoord_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/groupcoord_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/eulerangles_harmonic-fixed-euler/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/eigenvector-normalized_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/eigenvector-normalized_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/eigenvector-difference_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/eigenvector-difference_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/eigenvector_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/eigenvector_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distancez-fitgroup_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distancez-fitgroup_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distancez-axis-fitgroup_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distancez-axis-fitgroup_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distancez-axis_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distancez-axis_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distancez_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distancez_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distancexy-fitgroup_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distancexy-fitgroup_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distancexy-axis_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distancexy-axis_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distancewalls/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distancewalls/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distancewalls-compatible/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distancewalls-compatible/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distancevec-fitgroup_harmonic-dvec-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distancevec-fitgroup_harmonic-dvec-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distancevec-fitgroup_harmonic-dvec-fixed-enableFitGradients/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distancevec-fitgroup_harmonic-dvec-fixed-enableFitGradients/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distancevec_harmonic-dvec-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distancevec_harmonic-dvec-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distancepairs_linear-distancepairs/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distancepairs_histogramrestraint-dp/AutoDiff/test_out.hr.hist.dat | Updated as part of this pull request. |
| tests/input_files/distancepairs_histogramrestraint-dp/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distanceinv_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distanceinv_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distancedir-fitgroup_harmonic-ddir-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distancedir-fitgroup_harmonic-ddir-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distancedir_harmonic-ddir-moving/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distancedir_harmonic-ddir-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distancedir_harmonic-ddir-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-wall-bypassExtended-off/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-wall-bypassExtended-off/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-runave/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-runave/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-grid-expand_metadynamics/AutoDiff/test_out.pmf | Updated as part of this pull request. |
| tests/input_files/distance-grid-expand_metadynamics/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-grid-expand_metadynamics/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-grid_metadynamics/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-grid_metadynamics/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-grid_metadynamics-wt/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-grid_metadynamics-wt/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-grid_metadynamics-ti/AutoDiff/test_out.metadynamics1.ti.count | Updated as part of this pull request. |
| tests/input_files/distance-grid_metadynamics-ti/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-grid_metadynamics-ti/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-grid_metadynamics-sigmas/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-grid_metadynamics-sigmas/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-grid_metadynamics-rebinfromgrids/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-grid_metadynamics-rebinfromgrids/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-grid_metadynamics-rebin/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-grid_metadynamics-rebin/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-grid_histogram/AutoDiff/test_out.histogram1.dat | Updated as part of this pull request. |
| tests/input_files/distance-grid_histogram/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-grid_histogram/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-grid_histogram-customgrid/AutoDiff/test_out.histogram1.dat | Updated as part of this pull request. |
| tests/input_files/distance-grid_histogram-customgrid/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-grid_histogram-customgrid/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-grid_harmonic-k-moving/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-grid_harmonic-k-moving/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-grid_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-grid_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-grid_harmonic-fixed-ti/AutoDiff/test_out.harmonic1.ti.count | Updated as part of this pull request. |
| tests/input_files/distance-grid_harmonic-fixed-ti/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-grid_harmonic-fixed-ti/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-grid_harmonic-centers-moving/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-grid_harmonic-centers-moving/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-grid_harmonic-centers-moving-ti/AutoDiff/test_out.harmonic1.ti.count | Updated as part of this pull request. |
| tests/input_files/distance-grid_harmonic-centers-moving-ti/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-grid_harmonic-centers-moving-ti/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-grid_abf/AutoDiff/test_out.count | Updated as part of this pull request. |
| tests/input_files/distance-grid_abf/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-grid_abf/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-grid_abf-customgrid/AutoDiff/test_out.count | Updated as part of this pull request. |
| tests/input_files/distance-grid_abf-customgrid/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-grid_abf-customgrid/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-extended/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-extended/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-extended-grid_histogram/AutoDiff/test_out.histogram1.dat | Updated as part of this pull request. |
| tests/input_files/distance-extended-grid_histogram/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-extended-grid_histogram/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-extended-grid_histogram-bypassExtended/AutoDiff/test_out.histogram1.dat | Updated as part of this pull request. |
| tests/input_files/distance-extended-grid_histogram-bypassExtended/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-extended-grid_histogram-bypassExtended/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-dihedral_histogram2d-periodic/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-dihedral_histogram2d-periodic/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-dihedral_histogram2d-periodic-customgrid/AutoDiff/test_out.histogram1.dat | Updated as part of this pull request. |
| tests/input_files/distance-dihedral_histogram2d-periodic-customgrid/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-dihedral_histogram2d-periodic-customgrid/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance-coeffs_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance-coeffs_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance_metadynamics-customgrid/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance_metadynamics-customgrid/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance_linear-k-moving/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance_linear-k-moving/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance_linear-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance_linear-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance_histogram-customgrid/AutoDiff/test_out.histogram1.dat | Updated as part of this pull request. |
| tests/input_files/distance_histogram-customgrid/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance_histogram-customgrid/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance_harmonicwalls-upper-k-moving/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance_harmonicwalls-upper-k-moving/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance_harmonicwalls-upper-k-moving-decoupling/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance_harmonicwalls-upper-k-moving-decoupling/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance_harmonicwalls-upper-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance_harmonicwalls-upper-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance_harmonicwalls-k-moving/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance_harmonicwalls-k-moving/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance_harmonicwalls-both-k-moving/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance_harmonicwalls-both-k-moving/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance_harmonicwalls-both-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance_harmonicwalls-both-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance_harmonic-k-moving/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance_harmonic-k-moving/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance_harmonic-k-moving-stages/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance_harmonic-k-moving-stages/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance_harmonic-centers-moving/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance_harmonic-centers-moving/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance_harmonic-centers-moving-stages/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance_harmonic-centers-moving-stages/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance_harmonic-centers-moving-full/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance_harmonic-centers-moving-full/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/distance_abmd/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/distance_abmd/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/dipolemagnitude_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/dipoleangle_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/dipoleangle_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/dihedralwalls/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/dihedralwalls/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/dihedral_histogram-customgrid-periodic/AutoDiff/test_out.histogram1.dat | Updated as part of this pull request. |
| tests/input_files/dihedral_histogram-customgrid-periodic/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/dihedral_histogram-customgrid-periodic/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/dihedral_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/dihedral_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/da_flipped.xyz | Updated as part of this pull request. |
| tests/input_files/customfunction_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/customfunction_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/coordnum-pairlist-large_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/coordnum-pairlist-large_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/coordnum-pairlist_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/coordnum-pairlist_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/coordnum-group2centeronly_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/coordnum-group2centeronly_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/coordnum-aniso-pairlist_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/coordnum-aniso_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/coordnum-aniso_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/coordnum_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/coordnum_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/input_files/angle_harmonic-fixed/AutoDiff/test_out.colvars.traj | Updated as part of this pull request. |
| tests/input_files/angle_harmonic-fixed/AutoDiff/test_out.colvars.state | Updated as part of this pull request. |
| tests/functional/run_colvars_test.cpp | Updated as part of this pull request. |
| tests/functional_gpu/CMakeLists.txt | Updated as part of this pull request. |
| src/colvarmodule.cpp | Updated as part of this pull request. |
| src/colvaratoms_gpu.cpp | Updated as part of this pull request. |
| misc_interfaces/stubs/colvarproxy_stub.h | Updated as part of this pull request. |
| misc_interfaces/stubs/colvarproxy_stub.cpp | Updated as part of this pull request. |
Review effort: Balanced
There was a problem hiding this comment.
🔵 Needs a closer look
The scientific baseline changes and GPU stub integration require domain review and numerical validation, including CUDA/HIP runtime checks of atom mapping and applied forces unavailable in this environment.
No open issues 🎉
2 resolved since last review
Review effort: Balanced
giacomofiorin
left a comment
There was a problem hiding this comment.
Useful improvements, should we want to use the stub interface beyond the original tests inputs.


Summary
When I was trying to implement PBC support for the stub test interfaces using Claude, it complained that the atom mapping is wrong in case of reading the XYZ trajectory files. This PR aims to fix the issue and regenerate all test reference files.
After fixing the atom mapping, there are four tests with exactly zero gradients, namely orientationangle, rmsd, rmsd_sym and tilt, which fail the
debug_gradients()tests, so the reference files have to be perturbed to make the numerical comparison more robust.Related issue(s)
N/A
Affected engine(s)
CPU and GPU stub interfaces
Author(s)
@HanatoK
Licensing
By submitting this pull request, I agree that my contribution will be included in Colvars repository and redistributed under the GNU Lesser General Public License (LGPL) version 3.
Note: NAMD, VMD and TinkerHP follow more restrictive licenses, e.g. the UIUC license. However, the terms of the LGPLv3 remain in effect for the copies of the Colvars code distributed alongside those packages.
Artificial Intelligence (AI)
Yes. This commit was prepared completely by using Claude Opus 5.5 and Claude Code. My conversion with Claude is attached.
2026-10-22-163419-pastedcontent-idc7a0.txt
Further information / links